package itsm.isperp.framework.data.domain;

import itsm.isperp.framework.data.ObjectSqlSource;
import itsm.isperp.framework.web.request.JqGridFilterRuleOp;

import java.util.List;

import org.springframework.data.domain.Pageable;

/**
 * 查询过滤器， 具有实体的过滤过规则接口
 * 
 * @author lizx
 * @date 2013-1-27
 * @version V1.0
 */
public interface QueryFilter extends ObjectSqlSource {

	public static final String DEFAULT_OP = "AND";

	/**
	 * 获取查询的分页器
	 * 
	 * @return 分页器
	 */
	public Pageable getPageable();

	/**
	 * 获取查询过滤器的过滤规则
	 * 
	 * @return 过滤规则列表
	 */
	public List<? extends FilterRule> getRules();

	/**
	 * 增加一个过来规则
	 * 
	 * @param rule
	 *            {@link FilterRule}
	 */
	public <RULE extends FilterRule> void addRule(RULE rule);

	void addRule(String field, JqGridFilterRuleOp op, String data);

	// public String getSql();

}
